{extend name="layout"}
{block name="detail"}

<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-body p-b-0">
                <ul class="nav nav-tabs customtab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link allOrder active"  href="{:url('admin/order/order')}" role="tab">
                            <span class="hidden-sm-up"><i class="ti-home"></i></span>
                            <span class="hidden-xs-down">系统订单</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link waitSend"  href="{:url('admin/order/order')}?t=waitSend" role="tab">
                            <span class="hidden-sm-up"><i class="ti-home"></i></span>
                            <span class="hidden-xs-down">待发货</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link waitRefund"  href="{:url('admin/order/order')}?t=waitRefund" role="tab">
                            <span class="hidden-sm-up"><i class="ti-home"></i></span>
                            <span class="hidden-xs-down">等待退款</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link successRefund"  href="{:url('admin/order/order')}?t=successRefund" role="tab">
                            <span class="hidden-sm-up"><i class="ti-home"></i></span>
                            <span class="hidden-xs-down">退款成功</span>
                        </a>
                    </li>
                </ul>

                <form class="mt-3 mb-3"  method="get" action="{:url('admin/order/order_search')}">

                <!--所有订单-->
                    <input type="hidden" name="t" value="{$t}">
                    <input type="text" class="form-control" value="{$k}" name="k" required placeholder="请输入卖家uid，商品id，订单号，商户单号等关键词搜索" autocomplete="off">
                </form>

                {if condition="$orders"/}
                <table  class="table table-bordered table-hover toggle-circle m-t-20" >
                    <thead>
                    <tr class="text-align">
                        <th>用户昵称</th>
                        <th>商品</th>
                        <th>订单号</th>
                        <th>金额</th>
                        <th>支付时间</th>
                        <th>订单状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="orders" id="order"/}
                    <tr class="text-align">
                        <td class="text-center">
                            <img src="{$order.userImg}" alt="" width="30" style="border-radius: 100%">
                            <p>{$order.nickname}<br>{$order.uid}</p>
                        </td>
                        <td>{$order.title}</td>
                        <td>{$order.payment_order_id}</td>
                        <td>{$order.totalFee/100} </td>
                        <td>{if condition="$order.payTime"}{$order.payTime|date="Y-m-d H:i:s",###}{/if} </td>
                        <td>

                            {$order_status[$order.status]} <br>
                            {if condition="$order.status2 gt 0"}
                                {$order_status[$order.status2]}
                            {/if}
                        </td>
                        <td><a href="{:url('admin/order/order_detail',array('id'=>$order.id))}">详情</a></td>
                    </tr>
                    {/volist}
                    </tbody>
                    <tfoot>
                    {if condition="isset($isPagination)"}
                    <tr><td colspan="12">{$orders->render()}</td></tr>
                    {/if}
                    </tfoot>
                </table>
                {/if}
            </div>
        </div>
    </div>
</div>
<script>
    var t = "{$t}";
    if(!t){
        $(".nav-link").removeClass('active');
        $(".allOrder").addClass('active');
    }
    else{
        $(".nav-link").removeClass('active');
        $("."+t+"").addClass('active');
    }
</script>
{/block}